package com.steven.im.adapter;

import android.widget.ImageView;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.squareup.picasso.Picasso;
import com.steven.im.App;
import com.steven.im.R;
import com.steven.im.entity.HomeCategoryEntity;

import java.util.List;

/**
 * Created by Steven on 2019/1/9.
 */
public class HomeCenterRecycleAdapter extends BaseQuickAdapter<HomeCategoryEntity, BaseViewHolder> {

    public HomeCenterRecycleAdapter(List<HomeCategoryEntity> list) {

        super(R.layout.home_center_gridview, list);
    }


    @Override
    protected void convert(BaseViewHolder helper, HomeCategoryEntity item) {
        ((TextView) helper.getView(R.id.name)).setText(item.getTitle());
        Picasso.with(App.getContext()).load(item.getIconUrl()).into(((ImageView) helper.getView(R.id.img)));
    }
}
